package com.theo.service.impl;

import com.theo.entity.VaccineInfo;
import com.theo.mapper.VaccineInfoMapper;
import com.theo.service.VaccineInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 方涛
 * @since 2021-02-02
 */
@Service
public class VaccineInfoServiceImpl extends ServiceImpl<VaccineInfoMapper, VaccineInfo> implements VaccineInfoService {

    @Autowired
    private VaccineInfoMapper vaccineInfoMapper;

    @Override
    public int saveVaccineInfo(VaccineInfo vaccineInfo) {
        return vaccineInfoMapper.insert(vaccineInfo);
    }

    @Override
    public int deleteVaccineInfo(Integer id) {
        return vaccineInfoMapper.deleteById(id);
    }

    @Override
    public int updateVaccineInfo(VaccineInfo vaccineInfo) {
        return vaccineInfoMapper.updateById(vaccineInfo);
    }

    @Override
    public List<VaccineInfo> queryAllVaccineInfo() {
        return vaccineInfoMapper.selectList(null);
    }

    @Override
    public VaccineInfo queryVaccineInfoById(Integer id) {
        return vaccineInfoMapper.selectById(id);
    }
}
